package com.whm.hrmanagement.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.whm.common.utils.DateUtils;
import com.whm.hrmanagement.domain.OaStaffAttendance;
import com.whm.hrmanagement.mapper.OaStaffAttendanceMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.whm.hrmanagement.mapper.OaSalaryDeductMapper;
import com.whm.hrmanagement.domain.OaSalaryDeduct;
import com.whm.hrmanagement.service.IOaSalaryDeductService;

/**
 * 工资扣除Service业务层处理
 * 
 * @author whm
 * @date 2024-02-09
 */
@Service
public class OaSalaryDeductServiceImpl extends ServiceImpl<OaSalaryDeductMapper, OaSalaryDeduct> implements IOaSalaryDeductService
{
    @Autowired
    private OaSalaryDeductMapper oaSalaryDeductMapper;

    /**
     * 查询工资扣除
     * 
     * @param id 工资扣除主键
     * @return 工资扣除
     */
    @Override
    public OaSalaryDeduct selectOaSalaryDeductById(String id)
    {
        return oaSalaryDeductMapper.selectOaSalaryDeductById(id);
    }

    /**
     * 查询工资扣除列表
     * 
     * @param oaSalaryDeduct 工资扣除
     * @return 工资扣除
     */
    @Override
    public List<OaSalaryDeduct> selectOaSalaryDeductList(OaSalaryDeduct oaSalaryDeduct)
    {
        return oaSalaryDeductMapper.selectOaSalaryDeductList(oaSalaryDeduct);
    }

    /**
     * 新增工资扣除
     * 
     * @param oaSalaryDeduct 工资扣除
     * @return 结果
     */
    @Override
    public int insertOaSalaryDeduct(OaSalaryDeduct oaSalaryDeduct)
    {
        oaSalaryDeduct.setCreateTime(DateUtils.getNowDate());
        return oaSalaryDeductMapper.insertOaSalaryDeduct(oaSalaryDeduct);
    }

    /**
     * 修改工资扣除
     * 
     * @param oaSalaryDeduct 工资扣除
     * @return 结果
     */
    @Override
    public int updateOaSalaryDeduct(OaSalaryDeduct oaSalaryDeduct)
    {
        oaSalaryDeduct.setUpdateTime(DateUtils.getNowDate());
        return oaSalaryDeductMapper.updateOaSalaryDeduct(oaSalaryDeduct);
    }

    /**
     * 批量删除工资扣除
     * 
     * @param ids 需要删除的工资扣除主键
     * @return 结果
     */
    @Override
    public int deleteOaSalaryDeductByIds(String[] ids)
    {
        return oaSalaryDeductMapper.deleteOaSalaryDeductByIds(ids);
    }

    /**
     * 删除工资扣除信息
     * 
     * @param id 工资扣除主键
     * @return 结果
     */
    @Override
    public int deleteOaSalaryDeductById(String id)
    {
        return oaSalaryDeductMapper.deleteOaSalaryDeductById(id);
    }
}
